<?php
	header( 'Cache-Control: no-cache' );
	header( 'Content-type: application/xml; charset="utf-8"', true );

	include_once('conexao.php');

	$cod_categoria = mysql_real_escape_string($_REQUEST['categoria'] );
	$subcategoria = array();

	$sql = "SELECT  id, id_cat, sub
			FROM sub_cat
			WHERE id_cat =$cod_categoria
			ORDER BY id";
	$res = mysql_query( $sql );
	while ( $row = mysql_fetch_assoc( $res ) ) {
		$subcategoria[] = array(
			'subcategoria'              => $row['id'],
			'sub'						=> $row['sub'],
		);
	}

	echo( json_encode( $subcategoria ) );